\IfPackageLoaded{todonotes}{
  \clearpage
  \IfPackageLoaded{hyperref}{\phantomsection}
  \todototoc   % add to toc 
  \listoftodos % print to document
}
